<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="text"></div>
    <input type="hidden" name="hide" class="hide">
    <button class="btn">提交</button>
    <script>
        var text = document.getElementById('#text');
        var hide = document.getElementsByClassName('.hide');
        var btn = document.getElementsByClassName('.btn');
        btn.onclick(function() {
            console.log(hide.value);
        });
    </script>
</body>

</html>